#pragma once

#include "AStar.h"
#include "MapTile.h"

namespace pathfinding
{
	class Map;

	class TileNode
	{
	public:
		TileNode();
		TileNode(Map* map, int x, int y);

		float GoalDistanceEstimate(const TileNode& goal) const;

		bool IsGoal(const TileNode& nodeGoal) const;

		bool IsSameState(const TileNode& other) const;

		float GetCost(const TileNode& other) const;

		bool GetSuccessors(AStarSearch<TileNode>* search, const TileNode* parentNode) const;

		const MapTile& getTile() const {return _tile;}

		const IntPoint& getTileCoords() const;
	protected:
		IntPoint _coords;
		MapTile _tile;
		Map* _map;
	};
}